@import 'call-me-back-admin';

$call-me-back-offset: 20px;

.call-me-back {
    position: fixed;
    z-index: 100001;
    right: $tlp-double-spacing + $call-me-back-offset;
    bottom: $tlp-double-spacing;
}

@mixin message-colors($color) {
    border: 1px solid $color;
    color: $color;

    a {
        color: $color;
        text-decoration: underline;
    }
}

.call-me-back-message {
    position: absolute;
    left: -15px;
    width: 150px;
    padding: $tlp-spacing;
    transform: translateY(-100%);
    border-radius: 3px;
    background: transparentize($tlp-ui-white, .2);
    font-size: 14px;
    font-weight: 600;
    line-height: 22px;
    text-align: center;
    cursor: default;

    @if $tlp-theme-color == $tlp-theme-blue {
        @include message-colors($tlp-theme-orange);
    } @else if $tlp-theme-color == $tlp-theme-green {
        @include message-colors($tlp-theme-red);
    } @else if $tlp-theme-color == $tlp-theme-grey {
        @include message-colors($tlp-theme-orange);
    } @else if $tlp-theme-color == $tlp-theme-orange {
        @include message-colors($tlp-theme-blue);
    } @else if $tlp-theme-color == $tlp-theme-purple {
        @include message-colors($tlp-theme-orange);
    } @else if $tlp-theme-color == $tlp-theme-red {
        @include message-colors($tlp-theme-green);
    }

    > p {
        font-size: 14px;
        line-height: 22px;
    }
}

@mixin change-button-color($color) {
    border-color: $color;
    background: $color;

    &:hover {
        border-color: darken($color, 5%);
        background: darken($color, 5%);
    }

    &:active,
    &:focus {
        border-color: darken($color, 10%);
        background: darken($color, 10%);
    }
}

.call-me-back-button {
    position: relative;
    top: -5px;
    left: $call-me-back-offset;
    width: 85px;
    height: 85px;
    overflow: visible;
    border-radius: 50%;
    box-shadow: 0 3px 9px 0 rgba(0, 0, 0, .29);
    font-size: 30px;

    @if $tlp-theme-color == $tlp-theme-blue {
        @include change-button-color($tlp-theme-orange);
    } @else if $tlp-theme-color == $tlp-theme-green {
        @include change-button-color($tlp-theme-red);
    } @else if $tlp-theme-color == $tlp-theme-grey {
        @include change-button-color($tlp-theme-orange);
    } @else if $tlp-theme-color == $tlp-theme-orange {
        @include change-button-color($tlp-theme-blue);
    } @else if $tlp-theme-color == $tlp-theme-purple {
        @include change-button-color($tlp-theme-orange);
    } @else if $tlp-theme-color == $tlp-theme-red {
        @include change-button-color($tlp-theme-green);
    }

    > .fa {
        position: relative;
        top: -1px;
    }
}

.call-me-back-form {
    top: 15px;
    width: 220px;
    padding: $tlp-spacing;

    > .call-me-back-form-intro {
        font-size: 14px;
    }

    > .tlp-alert-danger {
        padding: $tlp-half-spacing;
        font-size: 14px;
    }

    .flatpickr-wrapper.static {
        display: block;
        order: 2;

        > .flatpickr-input {
            border-top-left-radius: 0;
            border-bottom-left-radius: 0;
        }

        > .flatpickr-calendar {
            top: 0;
            left: 0;
            transform: translateX(-100%) translateX(-45px) translateY(-43%);

            &::before,
            &::after {
                content: '';
                display: block;
                position: absolute;
                top: 50%;
                left: 100%;
                width: 0;
                height: 0;
                transform: translate(50%, -50%);
                border: solid transparent;
                border-width: 10px;
            }

            &::before {
                margin: 0 -9px;
                border-left-color: $tlp-ui-border-normal;
            }

            &::after {
                border-left-color: $tlp-ui-white;
            }
        }
    }
}

.call-me-back-save-the-date {
    display: flex;
    flex-direction: column;
    align-items: center;

    > .fa-thumbs-o-up {
        margin: 0 0 20px;
        color: $tlp-ui-success;
        font-size: 65px;
    }

    > .tlp-badge-success {
        padding: 10px 14px;
        border-radius: 20px;
        font-size: 16px;
    }
}
